<template>
  <div class="page_container">
    <PageTitle />

    <ScrollContainer>
      <Form
        :data="opts"
        :rows="4"
        :cols="2"
        label-width="95px"
      >
        <template #accountId>
          <el-input
            v-model="accountName"
            placeholder="请选择会员"
            @focus="1"
            suffix-icon="el-icon-caret-bottom"
            readonly
          ></el-input>
        </template>
        <template #activityId>
          <el-input
            v-model="activityName"
            placeholder="请选择贡献活动"
            @focus="1"
            suffix-icon="el-icon-caret-bottom"
            readonly
          ></el-input>
        </template>
      </Form>

      <template #btns>
        <el-button @click="confirm" type="primary" round>
          确认
        </el-button>
        <el-button @click="cancel" round>
          取消
        </el-button>
      </template>
    </ScrollContainer>
  </div>
</template>

<script>
import {
  addContribution,
} from '@/api/home/contribution.js';
import formMixin from './js/formMixin';

export default {
  name: 'ContributionAdd',
  mixins: [formMixin],
  data() {
    return {
      addFn: addContribution,
      cancelMessage: {
        msg: '确定取消新增贡献吗？',
      },
      cancelNavTo: {
        to: {
          name: 'Contribution',
        },
        from: this.$route.params.from,
        params: {
          removeTagViews: ['ContributionAdd']
        }
      },
      confirmNavTo: {
        name: 'ContributionDetail',
        params: {
          removeAliveRoters: ['Contribution'],
          removeTagViews: ['ContributionAdd']
        }
      }
    };
  },
};
</script>

<style lang="scss" scoped>

</style>
